<!--
 * @Description: ...
 * @Author: yangli 121029539@qq.com
 * @Date: 2025-02-06 11:23:56
 * @LastEditTime: 2025-02-13 15:16:56
 * @LastEditors: yangli 121029539@qq.com
 * @FilePath: \uniapp\src\pagesshopcenter\tixian.vue
-->
<template>
    <view class="bg-page ">
        <u-tabs class="base-tabs" :list="tabList" :is-scroll="false" v-model="current" @change="handleChange"   activeColor="var(--color-primary)" inactive-color="#606266" font-size="32"></u-tabs>
         <view class="page-list tabs  mt-[10px]  ">
            <z-paging auto-show-back-to-top ref="paging" v-model="dataList" @query="queryList" :fixed="false"
                height="100%">
                <view class="  border-solid border-0 border-b border-[#f5f5f5] bg-white p-[32rpx]  " 
                    v-for="(item, index) in dataList" :key="index">
                   <view class="flex flex-row items-start ">
                        <!-- 已提现 -->
                        <image v-if="item.status == 1"
                             src="/static/images/repair/applyed.png"
                            class="w-[80rpx] h-[80rpx]"
                        ></image>
                        <!-- 申请中 -->
                          <image v-else
                             src="/static/images/repair/applying.png"
                             class="w-[80rpx] h-[80rpx]"
                        ></image>
                        
                        <view class="flex flex-col flex-1 ml-[10px]">
                            <view class="mb-[10px] flex flex-row justify-between items-center self-stretch text-base">
                                <view class="font-semibold self-center text-[32rpx] text-main">
                                    {{item.status == 1 ? '已提现'   : '申请中'}}
                                </view>
                                 <view class="  text-error text-[32rpx]">
                                9.01
                            </view>
                            </view>
                             <view class="self-start text-muted text-base">
                                   2020-05-05 20:05:05
                                </view>
                          
                        </view>
                   </view>
                </view>
            </z-paging>
        </view>
    </view>
</template>

<script setup lang="ts">
import { tixianList} from '@/api/repair'
import {onLoad,onShow, onPageScroll} from "@dcloudio/uni-app";
import {computed, reactive, ref, shallowRef} from 'vue'
import {useAppStore} from '@/stores/app'
import { useUserStore } from '@/stores/user'

const appStore = useAppStore()
const userStore = useUserStore()
const token = computed(() => userStore.token)
const tabList = [{ name: '全部' }, { name: '提现中' }, { name: '已提现' }]

const current = ref<number>(0)
const paging = shallowRef<any>(null)
const dataList = ref<any[]>([])
const state = reactive({
    
})
const mock_list = [
    {
        id:1,
    },
    {
        id:2,
    },
    {
        id:3,
    }
]

const handleChange = (index: number) => {
    current.value = Number(index)
    paging.value.reload();
}

const queryList = async (page_no: number = 1, page_size: number = 10) => {
    try {
        // const { lists } = await tixianList({
        //     page_no,
        //     page_size,
        //     status: current.value
        // })
        // paging.value.complete(lists)
        paging.value.complete(mock_list)
    } catch (e) {
        console.log('报错=>', e)
        paging.value.complete(false)
    }
}

onLoad(() => {  })
</script>

<style lang="scss" scoped>

</style>
